package com.cskaoyan.mapper;

import com.cskaoyan.bean.vo.InnerCategoryOfCatAndBrandL1VO;
import com.cskaoyan.bean.vo.InnerCategoryOfCatAndBrandL2VO;
import com.cskaoyan.bean.MarketCategory;
import com.cskaoyan.bean.MarketCategoryExample;
import com.cskaoyan.bean.vo.wx.InnerCategoryOfWXHomeInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MarketCategoryMapper {
    long countByExample(MarketCategoryExample example);

    int deleteByExample(MarketCategoryExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketCategory record);

    int insertSelective(MarketCategory record);

    List<MarketCategory> selectByExample(MarketCategoryExample example);

    MarketCategory selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketCategory record, @Param("example") MarketCategoryExample example);

    int updateByExample(@Param("record") MarketCategory record, @Param("example") MarketCategoryExample example);

    int updateByPrimaryKeySelective(MarketCategory record);

    int updateByPrimaryKey(MarketCategory record);


    // //获取所有children的信息
    // ArrayList<AdminCategoryChildrenVo> selectAllListInfo();
    //
    // //获取类目等级为1的种类
    // List<MarketCategory> selectAllLevelOne(MarketCategory marketCategory);
    //
    // //根据等级为1的种类的pid获取对应的从属种类
    // List<AdminCategoryChildrenVo> selectAllLevelTwo(Integer levelOnePid);

    List<InnerCategoryOfCatAndBrandL1VO> selectValueAndLabel();

    List<InnerCategoryOfCatAndBrandL2VO> selectValueAndLabelById();

    Integer selectLevelOneId(Integer categoryId);

    /**
     * 插入新类目，同时给对象id属性赋值
     *
     * @param marketCategory 市场分类
     * @author: jinmo
     * @date: 2022/06/27 17:07:25
     */
    void insertReturnId(MarketCategory marketCategory);

    /**
     * 获取wx商城 首页数据
     * 返回三个值 id iconUrl name
     *
     * @return java.util.List<com.cskaoyan.bean.wx.InnerCategoryOfWXHomeInfoVo>
     * @author Can
     * @since 2022/06/28 18:07
     */
    List<InnerCategoryOfWXHomeInfoVo> selectWXHomeInfoData();

    /**
     * 通过一级id 查出所有的二级id
     *
     * @param levelOneId
     * @return java.util.List<java.lang.Integer>
     * @author Can
     * @since 2022/06/28 19:18
     */
    List<Integer> selectLevelTwoIdByLevelOneId(Integer levelOneId);

    List<MarketCategory> selectCurrentL2(@Param("id") Integer id,
                                         @Param("level") String level);
}